<meta charset="UTF-8">
<?php
set_time_limit(0);
include 'core/simplehtmldom/simple_html_dom.php';
include 'core/Core.Class';


 
$url =   isset($_POST['url']) && $_POST['url'] ? $_POST['url'] : '';

$filename =   isset($_POST['filename']) && $_POST['filename'] ? $_POST['filename'] : 'index';



if($url != ''){
    Core::getClass("GetHttp")->init($url ,$filename);    
    $error  = Core::$error;
    $downloadNum  = Core::$downloadNum;
}

?>
<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <meta name="Generator" content="EditPlus®">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <title>DownloadWebsitePage</title>
 </head>
 <body>
<?php if(isset($error) && $error){
          foreach ($error as $key => $value) {       
  ?>
 <div style="width:500px; border:1px solid rgba(95,53,54,1.00); margin:10px auto;">
  <?php echo $value;?>
  </div>
<?php }
    }?>
 <div style="width:500px; border:1px solid rgba(95,53,54,1.00); margin:100px auto;">
      <form method="post">
        url:<input type="text" name="url" />
        保存文件名<input type="text" name="filename" />
        <input type="submit" />
      </form>
  </div>
  <?php if(isset($downloadNum) && $downloadNum){?>
    <div style="width:500px; margin:10px auto;">
      共下载 <?php echo $downloadNum;?> 个文件;
    </div>
  <?php }?>
 </body>
</html>
